app.service('mainService',function () {
    var data = {};
    this.setData = function (newData) {
        data = newData ;
    };
    this.getData = function () {
        return data ;
    }
    var fzrtz = '';
    this.setFzrtz = function (newData) {
        fzrtz = newData
    }
    this.getFzrtz = function () {
        return fzrtz;
    }
    var fzr = '';
    this.setFzr = function (newData) {
        fzr = newData
    }
    this.getFzr = function () {
        return fzr;
    }
    var yjyabj = '';
    this.setYjyabj = function (newData) {
        yjyabj= newData
    }
    this.getYjyabj = function () {
        return yjyabj;
    }
    var yjya = '';
    this.setYjya = function (newData) {
        yjya = newData;
    }
    this.getYjya = function () {
        return yjya;
    };
    var arr = [];
    this.setArr = function (newData) {
        arr.push(newData)
    };
    this.getArr = function () {
        return arr;
    };
    this.clearArr = function () {
        arr = []
    }
    var yhxqfzr = '';
    this.setyhxqFzr = function (newData) {
        yhxqfzr = newData
    }
    this.getyhxqFzr = function () {
        return yhxqfzr;
    }
var yjyaData=[];
    this.setyjyaData = function (newData) {
        yjyaData.push(newData)
    };
    this.getyjyaData= function () {
        return yjyaData;
    };
    this.clearyjyaData = function () {
        yjyaData = []
    }
    var fzrData=[];
    this.setfzrData = function (newData) {
        fzrData.push(newData)
    };
    this.getfzrData= function () {
        return fzrData;
    };
    this.clearfzrData = function () {
        fzrData = []
    }
    //页面传值到详情
    var dysyh ='';
    var dzpdb ='';
    var ddbyh ='';
    var lzyhdcl ='';
    var ljdsq ='';
    var ljdsp ='';
    var dlr ='';
    this.setXq = function (code,data) {
        switch (code){
            case 103:
                dysyh = data;
                break;
            case 105:
                dzpdb = data;
                break;
            case 106:
                ddbyh = data;
                break;
            case 107:
                lzyhdcl = data;
                break;
            case 110:
                ljdsq = data;
                break;
            case 111:
                ljdsp = data;
                break;
            case 112:
                dlr = data;
                break;
        }
    };
    this.getXq = function (code) {
        switch (code){
            case 103:
                return dysyh ;
                break;
            case 105:
                return dzpdb ;
                break;
            case 106:
                return ddbyh ;
                break;
            case 107:
                return lzyhdcl ;
                break;
            case 110:
                return ljdsq ;
                break;
            case 111:
                return ljdsp ;
                break;
            case 112:
                return  dlr ;
                break;
        }
    };

    var loujianshengqing = '';
    this.setLjsq= function (newData) {
        loujianshengqing = newData;
    }
    this.getLjsq = function () {
        return loujianshengqing;
    }
var imgTobase64='';
    this.setUrl = function (newData) {
        imgTobase64 = newData;
    }
    this.getUrl = function () {
        return imgTobase64;
    }
    var file={};
    this.setFile = function (newData) {
        file = newData;
    }
    this.getFile = function () {
        return file;
    }


    this.reset = function () {
       data = {};
       fzr = '';
       yjyabj = '';
       yjya = '';
       yhxqfzr = '';
       imgTobase64='';
       localStorage.removeItem('dateInput')
    }
});